package org.xczy.order.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

  private final String STOCK_URL = "http://127.0.0.1:8001";

  @Resource
  private RestTemplate restTemplate;

  @GetMapping("/stock")
  public String add(){
    String s = restTemplate.getForObject(STOCK_URL + "/stock/redact",String.class);
    return "成功 --> " + s;
  }

}
